import { createRouter, createWebHistory } from 'vue-router'
import login from '@/components/login.vue'
import register from '@/components/register.vue'
import home from '@/views/home.vue'  

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect:'/login'
    },
    {
      path: '/login',
      name: 'login',
      component: login,
    },
    {
      path: '/register',
      name: 'register',
      component: register,
    },
    {
      path:'/home',
      name:'home',
      component:home,
      children: [
        {
          path: '/dailyData',
          name: 'dailyData',
          component: ()=>import('@/components/healthManagement/dailyData.vue'),
        },
        {
          path:'/checkIn',
          name:'checkIn',
          component:()=>import('@/components/fileManagement/checkIn.vue')
        },
        {
          path:'/fileUpdate',
          name:'fileUpdate',
          component:()=>import('@/components/fileManagement/fileUpdate.vue')
        },
        {
          path:'/payment',
          name:'payment',
          component:()=>import('@/components/fileManagement/payment.vue')
        },
        {
          path:'/activityArrangement',
          name:'activityArrangement',
          component:()=>import('@/components/dailyManagement/activityArrangement.vue')
        },
        {
          path:'/nursingLog',
          name:'nursingLog',
          component:()=>import('@/components/dailyManagement/nursingLog.vue')
        },
        {
          path:"/bedManagement",
          name:"bedManagement",
          component:()=>import('@/components/stayManagement/bedManagement.vue')
        },
        {
          path:"/bedStatus",
          name:"bedStatus",
          component:()=>import('@/components/stayManagement/bedStatus.vue')
        },{
          path:'/staffManagement',
          name:'staffManagement',
          component:()=>import('@/components/authorityManagement/staffManagement.vue')
        }
      ]
    }
  ],
})

export default router
